from django.db import models


# Create your models here.


# 正在热映表
class T_new_movie(models.Model):
    id = models.AutoField('ID', primary_key=True)
    movie_id = models.IntegerField('电影ID')
    box_office = models.IntegerField('票房', null=True)
    buy = models.CharField('购票地址', max_length=255, null=True)
    remark = models.CharField('备注', max_length=45, null=True)

    class Meta:
        verbose_name_plural = '热映表'


# 电影库信息表
class T_movie(models.Model):
    id = models.AutoField('ID', primary_key=True)
    movie_name = models.CharField('电影名', max_length=20)
    directors = models.CharField('导演', max_length=45, null=True)
    country = models.CharField('国家', max_length=20, null=True)
    score = models.FloatField('评分', null=True)
    information = models.CharField('简介', max_length=255, null=True)
    actors = models.CharField('演员', max_length=45, null=True)
    url = models.CharField('电影封面地址', max_length=255, null=True)
    release_date = models.DateField('上映日期', null=True)
    parise_num = models.IntegerField('点赞数', default=0)
    star_num = models.IntegerField('收藏数', default=0)
    click_num = models.IntegerField('点击数', default=0)
    remark = models.CharField('备注', max_length=45, null=True)

    class Meta:
        verbose_name_plural = '影库信息表'


# 经典名句表
class T_movie_lines(models.Model):
    id = models.AutoField('ID', primary_key=True)
    movie_id = models.IntegerField('电影ID')
    line = models.CharField('名句', max_length=255)
    remark = models.CharField('备注', max_length=45, null=True)

    class Meta:
        verbose_name_plural = '名句表'


# 电影标签表
class T_movie_target(models.Model):
    id = models.AutoField('ID', primary_key=True)
    target = models.CharField('标签', max_length=10)
    remark = models.CharField('备注', max_length=45, null=True)

    class Meta:
        verbose_name_plural = '电影标签表'


# 电影分类表
class T_movie_class(models.Model):
    id = models.AutoField('ID', primary_key=True)
    target_id = models.IntegerField('标签ID')
    movie_id = models.IntegerField('电影ID', )
    remark = models.CharField('备注', max_length=45, null=True)

    class Meta:
        verbose_name_plural = '电影分类表'